﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

namespace MidSoft.message
{
    public partial class message : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            #region 加载菜单
            ChinaSoft.BLL.Common.Bind bllBind = new ChinaSoft.BLL.Common.Bind();
            DataSet ds = bllBind.GetDataSet("*", "V_RolePower", "(PowerId  between 26 and 27)  and   UserAccount='" + ChinaSoft.Common.Input.SetString(Session["UserAccount"]) + "'order by Sort,CreateTime desc");
            string result = string.Empty;
            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                DataTable dt = ds.Tables[0];
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    result = GetResult(result, dt.Rows[i]["PowerId"]);
                }
            }
            LiterMenu.Text = result;
            #endregion
        }
        private string GetResult(string result, object input)
        {
            switch (ChinaSoft.Common.Input.SetInt(input))
            {
                case 26:
                    result += "<li><a href=\"javascript:routeToWorkSpace('/Message/SysMessage/list.aspx')\" title='系统消息'>系统消息</a></li>";
                    break;
                case 27:
                    result += "<li><a href=\"javascript:routeToWorkSpace('/Message/SysMessage/Rubbish.aspx')\" title='回收站'>回收站</a></li>";
                    break;
            }
            return result;
        }
    }
}